﻿using MediatR;
using SheepStorage.API.Application.Command.YourTableNameCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandler
{
    public class YourTableNameDeleteCommandHandler : IRequestHandler<YourTableNameDeleteCommand, Results<int>>
    {
        private readonly IYourTableNameService _yourTableName;
        public YourTableNameDeleteCommandHandler(IYourTableNameService yourTableName)
        {
            _yourTableName = yourTableName;
        }

        public  async Task<Results<int>> Handle(YourTableNameDeleteCommand request, CancellationToken cancellationToken)
        {
            return Results<int>.DataResult(await _yourTableName.DeltetYourTableName(request.DawningsheepId));
        }
    }
}
